Guilhem Bonnefile tweaks (old) Magellan Explorist PMGNCMD,END issues.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 19 Sep 2013 19:45:29 +0000 (19:45 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 19 Sep 2013 19:45:29 +0000 (19:45 +0000)
gpsbabel/magproto.cc
gpsbabel/reference/magxfile [new file with mode: 0644]
gpsbabel/reference/route/magexplorist.rte
gpsbabel/testo.d/magellan.test

index a1e1b5f2cb2a09cbe5af838e259dc85d4af6e997..1cd64e772e62b3a11726aa66eb90e207a8abbf69 100644 (file)
@@ -912,6 +912,15 @@ mag_deinit(void)
   trk_head = NULL;
 }
 
+static void
+mag_wr_deinit(void)
+{
+  if (explorist) {
+    mag_writemsg("PMGNCMD,END");
+  }
+  mag_deinit();
+}
+
 /*
  * I'm tired of arguing with scanf about optional fields .  Detokenize
  * an incoming string that may contain empty fields.
@@ -1671,7 +1680,7 @@ ff_vecs_t magX_fvecs = {
   magX_rd_init,
   magX_wr_init,
   mag_deinit,
-  mag_deinit,
+  mag_wr_deinit,
   mag_read,
   mag_write,
   NULL,
diff --git a/gpsbabel/reference/magxfile b/gpsbabel/reference/magxfile
new file mode 100644 (file)
index 0000000..f9ea738
--- /dev/null
@@ -0,0 +1,19 @@
+$PMGNWPL,2805.200,N,08246.200,W,0000000,M,AL7394,872 6833 A TIDAL,a*43
+$PMGNWPL,2806.216,N,08246.733,W,0000000,M,AL7485,872 6853 TIDAL 1,a*33
+$PMGNWPL,2806.216,N,08246.733,W,0000000,M,AL7484,872 6853 TIDAL 2,a*31
+$PMGNWPL,2806.050,N,08246.367,W,0000000,M,AL7482,872 6853 TIDAL 4,a*34
+$PMGNWPL,2808.816,N,08245.483,W,0000000,M,AL7471,872 6892 TIDAL 1,a*3A
+$PMGNWPL,2808.816,N,08245.483,W,0000000,M,AL7470,872 6892 TIDAL 2,a*38
+$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7380,872 6899 TIDAL 1,a*35
+$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7379,872 6899 TIDAL 2,a*30
+$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7378,872 6899 TIDAL 3,a*30
+$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7377,872 6899 TIDAL 4,a*38
+$PMGNWPL,2809.017,N,08246.283,W,0000000,M,AL7376,872 6899 TIDAL 5,a*38
+$PMGNWPL,2809.216,N,08248.033,W,0000000,M,AL7386,872 6904 TIDAL 1,a*32
+$PMGNWPL,2809.216,N,08248.033,W,0000000,M,AL7385,872 6904 TIDAL 2,a*32
+$PMGNWPL,2809.216,N,08248.033,W,0000000,M,AL7384,872 6904 TIDAL 3,a*32
+$PMGNWPL,2809.216,N,08248.017,W,0000000,M,AL7383,872 6904 TIDAL 4,a*34
+$PMGNWPL,2809.216,N,08248.017,W,0000000,M,AL7382,872 6904 TIDAL 5,a*34
+$PMGNWPL,2809.617,N,08245.933,W,0000000,M,AL6625,872 6905 TIDAL 5,a*3B
+$PMGNWPL,2809.383,N,08244.666,W,0000000,M,AL7392,872 6906 TIDAL 2,a*31
+$PMGNCMD,END*3D
index 0ca044eda412af7832df23a85586286c884561e1..fe141c1ef284a522f042b00f08e6184667a0ef70 100644 (file)
@@ -4,3 +4,4 @@ $PMGNWPL,3401.816,N,11751.349,W,0000226,M,WPT008,,a*2F
 $PMGNWPL,3405.686,N,11751.836,W,0000201,M,WPT009,,a*2B\r
 $PMGNRTE,2,1,c,1,Route 1,WPT006,a,WPT007,a*63\r
 $PMGNRTE,2,2,c,1,Route 1,WPT008,a,WPT009,a*60\r
+$PMGNCMD,END*3D\r
index 582013991ca8e24b225dc9f1d6e0ef908ad241dc..b76fa4e321107ab413701a051be83640b5667dae 100644 (file)
@@ -10,8 +10,8 @@ compare ${TMPDIR}/magfile ${REFERENCE}/magfile
 # Magellanx is just like, but with longer names. (which this admittedly
 # doesn't actually exercise...)
 #
-gpsbabel -i magellan -f ${REFERENCE}/magfile -o magellanx -F ${TMPDIR}/magfile2
-compare ${TMPDIR}/magfile2 ${REFERENCE}/magfile
+gpsbabel -i magellan -f ${REFERENCE}/magxfile -o magellanx -F ${TMPDIR}/magxfile
+compare ${TMPDIR}/magxfile ${REFERENCE}/magxfile
 
 # Magellanx routes, however, have an extra 'name' field in them.
 gpsbabel -r -i magellanx -f ${REFERENCE}/route/magexplorist.rte -o magellanx -F ${TMPDIR}/magxfile.rte